<template>
	<view class="content padding">
		<view class="padding ffffff border_2 flexbetween">
			<view class="shilitu">
				<image :src="info.info.image_text" mode="widthFix"></image>
			</view>
			<view class="" style="width: 74%;">
				<!-- <view class="yihang text_a color_san"></view> -->
				<view class="baise">{{info.info.name}}</view>
				<view class="flexbetween margin_top5">
					<view class="qianshu">¥{{info.info.price}}</view>
					<!-- <view class="shuliang">X1</view> -->
				</view>
			</view>
		</view>
		<view class="padding ffffff border_2 margin_top">
			<view class="text_weight color_ling text" v-if="info.groupbuyingdata.state==1">
				<text>仅差</text>
				<text style="color: rgba(243, 39, 28, 1)">{{info.groupbuyingdata.buying_total_num - info.groupbuyingdata.buying_now_num}}</text>
				<text>人，即可拼单成功！</text>
			</view>
			<view class="text_weight color_ling text" v-if="info.groupbuyingdata.state==2">
				拼团已成功！
			</view>
			<view class="text_weight color_ling text" v-if="info.groupbuyingdata.state==-1">
				拼团已取消！
			</view>
			<view class="margin_top4 flexcenter">
				<view class="imgBox margin_right3" v-for="item in info.groupbuyingdata.groupusers" :key="item.id">
					<image :src="item.avatar" mode="widthFix"></image>
				</view>
				<view class="questionBox" v-if="info.groupbuyingdata.groupusers.length!=info.groupbuyingdata.buying_total_num">?</view>
			</view>
			<view class="margin_top5 collageBtn" v-if="info.groupbuyingdata.state==1">
				一键拼单
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				order_id:"",
				info:{}
			}
		},
		onLoad(options) {
			this.order_id=options.id
			this.getInfo()
		},
		methods: {
			getInfo(){
				let _this = this;
				httpRequest.request("/api/goods_order/groupshare", 'POST', {
					order_id: _this.order_id
				}, false, false, true).then(res => {
					if (res.code == 1) {
						_this.info = res.data
					} else {
						httpRequest.toast(res.msg);
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.shilitu {
		width: 134rpx;
		height: 128rpx;
		border-radius: 14rpx;
 overflow: hidden;
		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}
	}

	.baise {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #999999;
		// margin: 12rpx 0rpx;
	}

	.shuliang {
		font-size: 26rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: rgba(243, 39, 28, 1);
	}

	.qianshu {
		font-size: 30rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: rgba(243, 39, 28, 1);
	}

	.imgBox {
		width: 106rpx;
		height: 106rpx;
		background: #D9D9D9;
		border-radius: 50%;
		border: 1rpx solid #D9D9D9;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.questionBox {
		width: 106rpx;
		height: 106rpx;
		line-height: 106rpx;
		text-align: center;
		background: #F8F8F8;
		border-radius: 50%;
		border: 1rpx dashed #C7C7C7;
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: rgba(204, 204, 204, 1);
	}

	.collageBtn {
		padding: 20rpx;
		text-align: center;
		background-color: rgba(243, 39, 28, 1);
		border-radius: 12rpx 12rpx 12rpx 12rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}
</style>